<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePushUrlFile extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('push_url_file', function (Blueprint $table) {
            $table->increments('id');
            $table->string('url')->comment('路径地址');
            $table->timestamps();
        });

        Schema::table('baidu_post_url', function (Blueprint $table) {
            if (!Schema::hasColumn('baidu_post_url', 'generate_status')) {
                $table->boolean('generate_status')->default(false)->comment('文件生成');
            }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('push_url_file');
    }
}
